All Functions Used So Far, Week 4

str

{utils}

Get the structure of an R object

max

{base}

Get maximum of a vector

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

desc

{dplyr}

Arrange in descending order

ordered

{dplyr}

Create an ordered factor

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

dim

{base}

Get dimensions of a data frame

xlab

{GGPLOT2}

Label the x axis (ggplot)

levels

{base}

Get levels of a factor

range

{base}

Return range of values

set.seed

{base}

Initialise a pseudorandom number generator.

unique

{base}

get unique elements

ncol

{base}

Get number of columns of a data frame

c

{base}

Combine values/vectors into a vector

sample

{base}

Takes a sample of the specified size

matrix

{base}

Creates a matrix from the given set of values.

cut

{base}

Convert Numeric to Factor

tabulate

{base}

Counts the number of times each integer occurs in an integer-only vector

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

geom_density

{GGPLOT2}

Generates a density plot

round

{base}

Rounds numbers

read_excel

{readxl}

Read an Excel file

class

{base}

Retrieve class of an R object

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

seq

{base}

Create a sequence

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

is.na

{base}

Check if a value is NA/elements of vector are NA

prop.test

{stats}

Test of Equal or Given Proportions

ungroup

{dplyr}

Resolve grouping created with “group_by”

complete.cases

{stats}

Find Complete Cases

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

rbeta

{stats}

Beta Random Number Generating Function

recode

{dplyr}

Recode a variable

rm

{base}

Remove objects

select

{dplyr}

Select columns from a tibble/data frame

ylab

{GGPLOT2}

Label the y axis (ggplot)

sum

{base}

Get sum of numeric values or a vector

mean

{base}

Get mean of a vector

which.max

{base}

return index of the largest value in a vector

sd

{stats}

Get standard deviation of a vector

with

{base}

evaluate expression in the context of a data frame

labs

{GGPLOT2}

Customise labels in GGPLOT2

boxplot

{graphics}

Plot a simple box plot

setwd

{base}

Set Working Directory

ifelse

{base}

Return a or b depending on the value of test

read.spss

{foreign}

Read a .sav file (SPSS data)

rbind

{base}

Combine R objects by rows

summary

{base}

Obtain summary statistics or detailed regression output

plot

{graphics}

Generic function from base R to produce a plot

ls.str

{utils}

Similarly to ls, with a print() method that calls str() on each object

lprop

{questionr}

Display row percentages of a two-way frequency table

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

nrow

{base}

Get number of rows of a data frame

ggtitle

{GGPLOT2}

Generates a title for a ggplot graph

median

{stats}

Get median of a vector

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

geom_histogram

{GGPLOT2}

Generates a histogram

order

{base}

Get indexes that will sort a vector

min

{base}

Get minimum of a vector

var

{stats}

Calculate variance

slice

{dplyr}

Subset rows using their positions

mutate

{dplyr}

Modify/create a column in a data frame

names

{base}

Retrieve names of a list/vector

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

geom_bar

{GGPLOT2}

Generates a bar chart

get_mode

{rstatix}

Compute the mode in a given vector.

freq

{questionr}

Generate frequency tables

after_stat

{GGPLOT2}

Control aesthetic evaluation. On the module used for displying percent

runif

{stats}

Draws ranndom numbers from the uniform distribution

library

{base}

Load an R package

rnorm

{base}

Generate random numbers from a normal distribution

factor

{base}

Create a factor

cbind

{base}

Combine R objects by columns

attach

{base}

Attach Set of R Objects to Search Path

pie

{graphics}

Creates a basic pie chart

hist

{graphics}

Plot a simple histogram

View

{base}

View a data frame

install.packages

{base}

Install R package

filter

{dplyr}

Filter out rows of a data frame according to logical vector

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

theme_bw

{GGPLOT2}

A black and white ggplot theme

head

{utils}

Show first 5 rows of a data frame

grid.arrange

{gridExtra}

Places graphical objects into a rectangular grid

ggplot

{GGPLOT2}

Create a ggplot graph

The end!